<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <title>用户注册 - 对勾网</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="__PUBLIC__/tpl2/css/bootstrap.css">
    <link rel="stylesheet" href="__PUBLIC__/tpl2/css/duigou.css">
    <script type="text/javascript" src="__PUBLIC__/tpl2/js/jquery.js"></script>
    <script type="text/javascript" src="__PUBLIC__/tpl2/js/bootstrap.js"></script>
    <script type="text/javascript" src="__PUBLIC__/tpl2/js/validform.js"></script>
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if IE 7]>
    <link rel="stylesheet" href="__PUBLIC__/tpl2/css/font-awesome-ie7.min.css"/>
    <![endif]-->
    <!--[if lt IE 9]>
    <script src="__PUBLIC__/tpl2/js/html5shiv.min.js"></script>
    <script src="__PUBLIC__/tpl2/js/respond.min.js"></script>
    <![endif]-->
</head>
<!--[if IE 7]>
<body class="ie7 search"><![endif]-->
<!--[if IE 8]>
<body class="ie8 search"><![endif]-->
<!--[if IE 9]>
<body class="ie9 search"><![endif]-->
<!--[if !IE]><!-->
<body style="height: 729px;" class="search"><!--<![endif]-->
<div class="duigou-login-register">
    <div class="login-brand">
        <a href="{$Think.config.web_url}"><img src="__PUBLIC__/tpl2/images/login-brand-reg.png"></a>
    </div>
    <div class="login-regsiter-wrap container-fluid">
        <div class="register-type">

        </div>
        <div class="register-content row" style="min-height:420px;*height:420px;">
            <div class="content-left col-md-8 col-sm-12">
                <form method="post" class="regform">
                    <input type="hidden" name="user_type" value="<eq name='choose' value='business'>1<else/>0</eq>"/>
                    <div class="input-group">
                        <!--<span class="input-group-addon"><i class="fa fa-user"></i></span>-->
                        <input name="mobile" id="phone" class="form-control" placeholder="请输入注册的手机号"
                               aria-describedby="basic-addon1"
                               ajaxurl="{:U('/Home/check')}"
                               datatype="/^1[3456789][0-9]{9}$/" errormsg="请填写正确的手机号码！" type="text">
                    </div>
                    <div class="input-br"></div>
                    <div class="container-fluid input-group">
                        <!--<span class="input-group-addon"><i class="fa fa-user"></i></span>-->
                        <div class="row clearfix">
                            <div class="col-md-7 col-sm-12 nopadding">
                                <input name="verify" id="verify" class="form-control" placeholder="请输入图片验证码"
                                       aria-describedby="basic-addon1" datatype="/^[A-Za-z0-9]{3,6}$/"
                                       errormsg="请填右侧图片里的验证码！" type="text"><!--ajaxurl="/User/Login/ajaxVerify" -->
                            </div>
                            <div class="col-md-4 col-sm-12 nopadding pull-right">
                                <img src="{:('/home/verify')}" id="flushVerify" height="46"
                                     width="125">
                            </div>
                        </div>
                    </div>
                    <div class="input-br"></div>
                    <!-- <div class="container-fluid input-group">
                         &lt;!&ndash;<span class="input-group-addon"><i class="fa fa-user"></i></span>&ndash;&gt;
                         <div class="row clearfix">
                             <div class="col-md-7 col-sm-12 nopadding">
                                 <input name="phoneverify" class="form-control" placeholder="请输入验证码"
                                        aria-describedby="basic-addon1" ajaxurl="/User/Login/ajaxPhoneVerify"
                                        datatype="/[0-9]{4}/" errormsg="请填写收到的验证码！" type="text">
                             </div>
                             <div class="col-md-4 col-sm-12 nopadding pull-right">
                                 <button class="btn btn-default btn-lg verify-send" style="width:100%;">发送验证码</button>
                             </div>
                         </div>
                     </div>-->
                    <div class="input-br"></div>
                    <!--<div class="input-group">-->
                    <!--&lt;!&ndash;<span class="input-group-addon"><i class="fa fa-user"></i></span>&ndash;&gt;-->
                    <!--<input type="text"name = 'email' class="form-control" placeholder="邮箱，方便面试通知" aria-describedby="basic-addon1" datatype="/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/" errormsg="邮箱格式不正确" ajaxurl="/User/Login/ajaxEmail">-->
                    <!--</div>-->
                    <!--<div class="input-br"></div>-->
                    <div class="input-group">
                        <!--<span class="input-group-addon"><i class="fa fa-user"></i></span>-->
                        <input name="password" class="form-control" placeholder="请输入密码" aria-describedby="basic-addon1"
                               datatype="*6-15" errormsg="密码范围在6~15位之间！" type="password">
                    </div>
                    <div class="input-br"></div>
                    <div class="input-group">
                        <label><input id="privacy" checked="checked" type="checkbox"> 我已阅读并同意 <a
                                href="http://www.duigoujob.com/privacy.html" target="_blank" style="color:#00bcd4;">《对勾网户协议》</a></label>
                    </div>
                    <div class="input-br privacy-error"></div>
                    <div class="input-group">
                        <button type="submit" class="btn btn-default btn-block btn-lg">注册</button>
                    </div>

                </form>
            </div>
            <div class="content-right col-md-4 col-sm-12">
                <div class="right-tips">已有帐号</div>
                <div class="input-group hidden-xs">
                    <a href="{:U('/home/login')}" class="btn btn-default btn-block btn-lg">立即登录</a>
                </div>
                <div class="oauth-wrap">
                    第三方平台<br><br>
                    <a href="http://www.duigoujob.com/User/Login/qqlogin" class="oauth oauth-qq"></a>
                    <a href="http://www.duigoujob.com/User/Login/sinalogin" class="oauth oauth-sina"></a>
                    <!--<a class="oauth oauth-wechat"></a>-->

                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        var time = 60;
        if ($('body').height() < $(window).height()) {
            $('body').css({height: $(window).height()});
        }
        $('.regform').Validform({
            tiptype: function (msg, o, cssctl) {
                if (o.type === 2) {
                    //验证成功
                    $(o.obj).parents('.input-group').next().removeClass('error').text('');

                }
                if (o.type === 3) {
                    //验证失败
                    $(o.obj).parents('.input-group').next().addClass('error').text(msg);

                }
            },
            beforeCheck: function (curform) {
                if (!$(curform).find('#privacy').prop('checked')) {
                    $('.privacy-error').addClass('error').text("请接受对勾网用户协议");
                    return false;
                } else {
                    $('.privacy-error').removeClass('error').text('');
                }
            },
        });

        $('.verify-send').on('click', function (e) {
            var that = $(this);
            var phone = $('#phone').val();
            if (!/^1[3578][0-9]{9}$/.test(phone) || phone.length != 11) {
                $('#phone').parents('.input-group').next().addClass('error').text('请先填写正确的手机号');
                return false;
            }
            if ($('#verify').val().length != 3) {
                $('#verify').parents('.input-group').next().addClass('error').text('请先填写验证码');
                return false;
            }
            $.post('/User/Login/ajaxCheck', {param: phone}, function (data) {
                if (data.status == 'n') {
                    $('#phone').parents('.input-group').next().addClass('error').text('手机已经被注册了');
                } else {
                    $.post('/User/Login/ajaxVerify', {param: $('#verify').val(), type: 0}, function (result) {
                        if (result.status == 'n') {
                            $('#verify').parents('.input-group').next().addClass('error').text('图片验证码错误');
                        } else {
                            that.prop('disabled', true);
                            that.text(time);
                            var clearTime = setInterval(function () {
                                if (time <= 0) {
                                    that.text('重新发送');
                                } else {
                                    that.text(--time);
                                }
                            }, 1000);
                            $.post('/User/Login/SendPhoneVerify', {
                                phone: $("input[name='phone']").val(),
                                param: $('#verify').val()
                            }, function (result) {
                                if (result.status) {
                                    that.text('请查看手机');
                                } else {
                                    that.prop('disabled', false);
                                    that.text('重新发送');
                                    alert(result.msg);
                                }
                                clearInterval(clearTime);
                            });
                        }
                    });

                }
            });
            e.preventDefault();
        });

        $('#flushVerify').on('click', function () {
            $(this).attr('src', "{:U('/Home/verify')}?r=" + Math.random());
        });
    });
</script>

</body>
</html>